﻿/*
#**************************************************************************
#  openSIS is a student information system for public and non-public 
#  schools from Open Solutions for Education, Inc. web: www.os4ed.com
#
#  openSIS is  web-based, open source, and comes packed with features that 
#  include student demographic info, scheduling, grade book, attendance, 
#  report cards, eligibility, transcripts, parent portal, 
#  student portal and more.   
#
#  Visit the openSIS web site at http://www.opensis.com to learn more.
#  If you have question regarding this system or the license, please send 
#  an email to info@os4ed.com.
#
#  This program is released under the terms of the GNU General Public License  
#  as  published by the Free Software Foundation, version 2 of the License. 
#  See license.txt.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#**************************************************************************** 

*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OSISStudentDataLayer;
using OpenSISSchoolDataLayer;
using System.Data;
using OSISDynamicTranslation;
using System.Web.UI.WebControls;


namespace OSISStudentBusinessLayer
{
    /// <summary>
    /// Summary description for StudentBL
    /// </summary>
    public class StudentBL
    {
        private int studentid;
        private string LanguageTool;
        private int altid;
        private int studistid;
        private int stustid;
        private int stusttestid;
        private string fname;
        private string mname;
        private string lname;
        private int gender;
        private int ethnicity;
        private string commonname;
        private string ssn;
        private string stumedalertind;
        private string birthdate;
        private string lastupdated;
        private int stu504ind;
        private int language;
        private string graddate;
        private int hispanicind;
        private int stumedinfoid;
        private string stuemail;
        private int grade;
        private string calender;
        private string retentionoptions;
        private string uname;
        private string password;
        private string attendancestartdateofschool;
        private string startcdn;
        private int schoolid;
        private string schoolname;

        //******************
        private int medinfoid;
        private int medinfotype;
        private string medinfodate;
        private string comments;
        private int stuenrid;
        private string enrstartdt;
        private string enrenddt;
        private string enrtitle1ind;
        private int nextschid;
        private int lastschid;
        private int schyrid;
        private string enrspedind;
        private int enrcdid;
        private string enrfreeredind;
        private string enrhmlsstsind;
        private string enrgiftedind;

        private int extrafieldid;

        private string suffix;

        private string customfieldvalue;

        private string fieldname;

        private int contsetid;
        private int addid;
        private int set;
        private int catid;
        private int fieldid;
        private int homefieldid;

        private int medalertactid;
        private int lifethreatind;


        //added for student add
        private string nursevisitdate;
        private string nursevisittimein;
        private string nursevisittimeout;
        private string nursevisitreason;
        private string nursevisitresult;
        private string nursevisitcomment;


        private string value;

        private string fieldcategory;
        private string photourl;

        //Enrollment
        private int enrollid;
        private string enrattstartdate;
        private string enrexitdate;
        private string enrexitcode;
        private string enrexitreason;
        private string enrstartcondition;
        private int enrschyrid;

        //enrollment


        private static string langto;


        public StudentBL()
        {

            //*************
            enrollid = 0;
            enrattstartdate = "";
            enrexitdate = "";
            enrexitcode = "";
            enrexitreason = "";
            enrstartcondition = "";

            studentid = 0;
            fieldid = 0;
            fname = "";
            mname = "";
            lname = "";
            gender = 0;
            ethnicity = 0;
            commonname = "";
            ssn = "";
            birthdate = "01/01/1900";
            language = Convert.ToInt32(null);
            graddate = "01/01/1900";
            altid = 0;
            grade = 0;
            calender = "";
            retentionoptions = "";
            uname = "";
            password = "";
            attendancestartdateofschool = "01/01/1900";
            startcdn = "";
            schoolid = 0;
            schoolname = "";

            studistid = 0;
            stustid = 0;
            stusttestid = 0;
            stumedalertind = "";
            lastupdated = "";
            stu504ind = 0;
            hispanicind = 0;
            stumedinfoid = 0;
            stuemail = "";
            medinfodate = "";
            comments = "";
            //**********************
            nursevisitdate = "";
            nursevisittimein = "";
            nursevisittimeout = "";
            nursevisitreason = "";
            nursevisitresult = "";
            nursevisitcomment = "";

            medalertactid = 0;
            lifethreatind = 0;
            //********************

            stuenrid = 0;
            enrstartdt = "01/01/1900";
            enrenddt = "01/01/1900";
            enrtitle1ind = "";
            nextschid = 0;
            lastschid = 0;
            schyrid = 0;
            enrspedind = "";
            enrcdid = 0;
            enrfreeredind = "";
            enrhmlsstsind = "";
            enrgiftedind = "";

            extrafieldid = 0;
            suffix = "";
            customfieldvalue = "";
            fieldname = "";
            catid = 0;

            medinfotype = 0;
            medinfoid = 0;
            set = 0;
            addid = 0;
            value = "";
            fieldcategory = "";
            homefieldid = 0;
            photourl = "";
            contsetid = 0;
            LanguageTool = "";
        }

        public string LangTool
        {
            get
            {
                return this.LanguageTool;
            }
            set
            {
                this.LanguageTool = value;
            }
        }

        //enrollemnt
        public int EnrollId
        {
            get
            {
                return this.enrollid;
            }
            set
            {
                this.enrollid = value;

            }
        }
        public int EnrSchyrId
        {
            get
            {
                return this.enrschyrid;
            }
            set
            {
                this.enrschyrid = value;

            }
        }
        public String EnrAttStartdate
        {
            get
            {
                return this.enrattstartdate;
            }
            set
            {
                this.enrattstartdate = value;

            }
        }
        public String EnrExitCode
        {
            get
            {
                return this.enrexitcode;
            }
            set
            {
                this.enrexitcode = value;

            }
        }
        public String EnrExitDate
        {
            get
            {
                return this.enrexitdate;
            }
            set
            {
                this.enrexitdate = value;

            }
        }
        public String EnrExitreason
        {
            get
            {
                return this.enrexitreason;
            }
            set
            {
                this.enrexitreason = value;

            }
        }
        public String EnrStartCondition
        {
            get
            {
                return this.enrstartcondition;
            }
            set
            {
                this.enrstartcondition = value;

            }
        }

        //enrollment


        public String PhotoUrl
        {
            get
            {
                return this.photourl;
            }
            set
            {
                this.photourl = value;

            }
        }


        public String MedInfoDate
        {
            get
            {
                return this.medinfodate;
            }
            set
            {
                this.medinfodate = value;

            }
        }

        public String Comments
        {
            get
            {
                return this.comments;
            }
            set
            {
                this.comments = value;

            }
        }

        public String NurseVisitDate
        {
            get
            {
                return this.nursevisitdate;
            }
            set
            {
                this.nursevisitdate = value;

            }
        }

        public String NurseVisitTimeIn
        {
            get
            {
                return this.nursevisittimein;
            }
            set
            {
                this.nursevisittimein = value;

            }
        }

        public String NurseVisitTimeOut
        {
            get
            {
                return this.nursevisittimeout;
            }
            set
            {
                this.nursevisittimeout = value;

            }
        }

        public String NurseVisitReason
        {
            get
            {
                return this.nursevisitreason;
            }
            set
            {
                this.nursevisitreason = value;

            }
        }

        public String NurseVisitResult
        {
            get
            {
                return this.nursevisitresult;
            }
            set
            {
                this.nursevisitresult = value;

            }
        }

        public String NurseVisitComment
        {
            get
            {
                return this.nursevisitcomment;
            }
            set
            {
                this.nursevisitcomment = value;

            }
        }

        public int MedInfoType
        {
            get
            {
                return this.medinfotype;
            }
            set
            {
                this.medinfotype = value;
            }
        }
        public int MedAlertActId
        {
            get
            {
                return this.medalertactid;
            }
            set
            {
                this.medalertactid = value;
            }
        }
        public int LifeThreatInd
        {
            get
            {
                return this.lifethreatind;
            }
            set
            {
                this.lifethreatind = value;
            }
        }

        public int MedInfoId
        {
            get
            {
                return this.medinfoid;
            }
            set
            {
                this.medinfoid = value;
            }
        }
        public int CatId
        {
            get
            {
                return this.catid;
            }
            set
            {
                this.catid = value;
            }
        }

        public int FieldId
        {
            get
            {
                return this.fieldid;
            }
            set
            {
                this.fieldid = value;
            }
        }

        public int AddId
        {
            get
            {
                return this.addid;
            }
            set
            {
                this.addid = value;
            }
        }

        public int Set
        {
            get
            {
                return this.set;
            }
            set
            {
                this.set = value;
            }
        }

        public int ContSetId
        {
            get
            {
                return this.contsetid;
            }
            set
            {
                this.contsetid = value;
            }
        }
        public int HomeFieldId
        {
            get
            {
                return this.homefieldid;
            }
            set
            {
                this.homefieldid = value;
            }
        }
        public int ExtrafieldId
        {
            get
            {
                return this.extrafieldid;
            }
            set
            {
                this.extrafieldid = value;
            }
        }

        public int StudentID
        {
            get
            {
                return this.studentid;
            }
            set
            {
                this.studentid = value;
            }
        }
        public int SchoolID
        {
            get
            {
                return this.schoolid;
            }
            set
            {
                this.schoolid = value;
            }
        }
        public String SchoolName
        {
            get
            {
                return this.schoolname;
            }
            set
            {
                this.schoolname = value;

            }
        }
        public String FName
        {
            get
            {
                return this.fname;
            }
            set
            {
                this.fname = value;

            }
        }
        public String MName
        {
            get
            {
                return this.mname;
            }
            set
            {
                this.mname = value;

            }
        }
        public String LName
        {
            get
            {
                return this.lname;
            }
            set
            {
                this.lname = value;

            }
        }
        public int Gender
        {
            get
            {
                return this.gender;
            }
            set
            {
                this.gender = value;

            }
        }
        public int Ethnicity
        {
            get
            {
                return this.ethnicity;
            }
            set
            {
                this.ethnicity = value;

            }
        }
        public String CommonName
        {
            get
            {
                return this.commonname;
            }
            set
            {
                this.commonname = value;

            }
        }
        public String SSN
        {
            get
            {
                return this.ssn;
            }
            set
            {
                this.ssn = value;

            }
        }
        public String BirthDate
        {
            get
            {
                return this.birthdate;
            }
            set
            {
                this.birthdate = value;

            }
        }
        public int Language
        {
            get
            {
                return this.language;
            }
            set
            {
                this.language = value;

            }
        }
        public String GradDate
        {
            get
            {
                return this.graddate;
            }
            set
            {
                this.graddate = value;

            }
        }

        public int Grade
        {
            get
            {
                return this.grade;
            }
            set
            {
                this.grade = value;

            }
        }
        public String Calender
        {
            get
            {
                return this.calender;
            }
            set
            {
                this.calender = value;

            }
        }
        public String RetentionOptions
        {
            get
            {
                return this.retentionoptions;
            }
            set
            {
                this.retentionoptions = value;

            }
        }
        public String UName
        {
            get
            {
                return this.uname;
            }
            set
            {
                this.uname = value;

            }
        }
        public String Password
        {
            get
            {
                return this.password;
            }
            set
            {
                this.password = value;

            }
        }
        public String AttendaceStartDateOfSchool
        {
            get
            {
                return this.attendancestartdateofschool;
            }
            set
            {
                this.attendancestartdateofschool = value;

            }
        }
        public String StartCondition
        {
            get
            {
                return this.startcdn;
            }
            set
            {
                this.startcdn = value;

            }
        }

        public int AltID
        {
            get
            {
                return this.altid;
            }
            set
            {
                this.altid = value;
            }
        }

        public int StuDistID
        {
            get
            {
                return this.studistid;
            }
            set
            {
                this.studistid = value;
            }
        }

        public int StuStID
        {
            get
            {
                return this.stustid;
            }
            set
            {
                this.stustid = value;
            }
        }

        public int StuSttestID
        {
            get
            {
                return this.stusttestid;
            }
            set
            {
                this.stusttestid = value;
            }
        }

        public String StuMedAlertInD
        {
            get
            {
                return this.stumedalertind;
            }
            set
            {
                this.stumedalertind = value;

            }
        }

        public String LastUpdatedDate
        {
            get
            {
                return this.lastupdated;
            }
            set
            {
                this.lastupdated = value;

            }
        }

        public int Stu504InD
        {
            get
            {
                return this.stu504ind;
            }
            set
            {
                this.stu504ind = value;
            }
        }

        public int HispanicInD
        {
            get
            {
                return this.hispanicind;
            }
            set
            {
                this.hispanicind = value;
            }
        }

        public int StuMedinfoID
        {
            get
            {
                return this.stumedinfoid;
            }
            set
            {
                this.stumedinfoid = value;
            }
        }


        public String StuEmail
        {
            get
            {
                return this.stuemail;
            }
            set
            {
                this.stuemail = value;

            }
        }




        public string FieldCategory
        {
            get
            {
                return this.fieldcategory;
            }
            set
            {
                this.fieldcategory = value;
            }
        }
        public string Value
        {
            get
            {
                return this.value;
            }
            set
            {
                this.value = value;
            }
        }


        //*****************

        public String EnrStartDate
        {
            get
            {
                return this.enrstartdt;
            }
            set
            {
                this.enrstartdt = value;

            }
        }

        public String EnrEndDate
        {
            get
            {
                return this.enrenddt;
            }
            set
            {
                this.enrenddt = value;

            }
        }

        public String EnrTitle1InD
        {
            get
            {
                return this.enrtitle1ind;
            }
            set
            {
                this.enrtitle1ind = value;

            }
        }

        public int NextSchID
        {
            get
            {
                return this.nextschid;
            }
            set
            {
                this.nextschid = value;

            }
        }

        public int LastSchID
        {
            get
            {
                return this.lastschid;
            }
            set
            {
                this.lastschid = value;

            }
        }

        public int SchyrID
        {
            get
            {
                return this.schyrid;
            }
            set
            {
                this.schyrid = value;

            }
        }

        public String EnrSpedInD
        {
            get
            {
                return this.enrspedind;
            }
            set
            {
                this.enrspedind = value;

            }
        }

        public int EnrCdID
        {
            get
            {
                return this.enrcdid;
            }
            set
            {
                this.enrcdid = value;

            }
        }

        public String EnrFreeRedInd
        {
            get
            {
                return this.enrfreeredind;
            }
            set
            {
                this.enrfreeredind = value;

            }
        }

        public String EnrHmlsStsInD
        {
            get
            {
                return this.enrhmlsstsind;
            }
            set
            {
                this.enrhmlsstsind = value;

            }
        }

        public String EnrGiftedInD
        {
            get
            {
                return this.enrgiftedind;
            }
            set
            {
                this.enrgiftedind = value;

            }
        }


        public String Suffix
        {
            get
            {
                return this.suffix;
            }
            set
            {
                this.suffix = value;

            }
        }

        public String CustomfieldValue
        {
            get
            {
                return this.customfieldvalue;
            }
            set
            {
                this.customfieldvalue = value;

            }
        }


        public String FieldName
        {
            get
            {
                return this.fieldname;
            }
            set
            {
                this.fieldname = value;

            }
        }

        public DataTable GetSchoolSpecificCategory()
        {
            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.getschoolspecificcategory(this);

          
            DynamicTranslation DTL = new DynamicTranslation();
            if (LangTool != "en")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string origtext = dt.Rows[i]["Cat_Name"].ToString();
                    string trantext = DTL.Translate(origtext, "en", LangTool);
                    dt.Rows[i]["Cat_Name"] = trantext;
                }
            }
            return dt;
        }


        public int StudentAdd()
        {
            StudentDL stDl = new StudentDL();
            int SchId = stDl.StudentAdd(this);
            return SchId;
        }




        public System.Data.DataTable populaterepeater()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.PopulatrRepeater(this);
            return dt;
        }

        public void SaveCustomData()
        {
            StudentDL stDl = new StudentDL();
            stDl.savecustomdata(this);
        }



        public DataTable populatecalender()
        {
            StudentDL stDl = new StudentDL();
            //ddl.Items.Clear();
            DataTable dt = null;
            dt = stDl.PopulateCalender(this);
            return dt;


            //ddl.DataSource = dt;
            //ddl.DataTextField = "Calender_Name";
            //ddl.DataValueField = "Caleder_Id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }


        public DataTable populateLanguage()
        {
            StudentDL stDl = new StudentDL();
            //ddl.Items.Clear();
            DataTable ds = null;
            ds = stDl.PopulateLanguage().Tables[0];
            return ds;
            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "language_nm";
            //ddl.DataValueField = "language_id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }

        public DataTable populateEthnicity()
        {
            StudentDL stDl = new StudentDL();
          //  ddl.Items.Clear();
            DataSet ds = null;
            ds = stDl.PopulateEthnicity();
            

            DynamicTranslation DTL = new DynamicTranslation();
            //langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();

            if (LangTool != "en")
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string origtext = ds.Tables[0].Rows[i]["eth_nm"].ToString();

                    string trantext = DTL.Translate(origtext, "", "");
                    ds.Tables[0].Rows[i]["eth_nm"] = trantext;


                }
            }

            return ds.Tables[0];


            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "eth_nm";
            //ddl.DataValueField = "eth_id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));


        }
        public DataTable populatedynamicddl()
        {
            StudentDL stDl = new StudentDL();
           
            DataSet ds = null;
            ds = stDl.Populatedynamiccontrols(this);
            return ds.Tables[0];

        }

        public DataTable populatedynamicrbtn()
        {
            StudentDL stDl = new StudentDL();
           
            DataSet ds = null;
            ds = stDl.Populatedynamiccontrols(this);
            return ds.Tables[0];

        }



        public DataTable populatedynamicrchk()
        {
            StudentDL stDl = new StudentDL();
            
            DataSet ds = null;
            ds = stDl.Populatedynamiccontrols(this);
            return ds.Tables[0];

        }


        public DataTable PopulateGrade()
        {
            StudentDL stDl = new StudentDL();
           
            DataSet ds = null;
            ds = stDl.populatrgrade();
            return ds.Tables[0];
           

        }
        public DataTable PopulateEnrollCdn()
        {
            StudentDL stDl = new StudentDL();
          
            DataSet ds = null;
            ds = stDl.populatrenrollmentcdn();
            return ds.Tables[0];

        }
        public DataTable propulateSchool()
        {
            SchoolDL scDl = new SchoolDL();
            
            DataSet ds = null;
            ds = scDl.PopulateSchool();
            return ds.Tables[0];


        }

        public void GetSchoolNamefromID()
        {
            StudentDL stDl = new StudentDL();
            DataTable dt = stDl.SchoolDetailsByID(this);
            if (dt.Rows.Count > 0)
            {
                schoolid = Convert.ToInt32(dt.Rows[0][0]);
                schoolname = dt.Rows[0]["sch_full_nm"].ToString();

            }
        }
        public void getStudentId()
        {
            StudentDL stDl = new StudentDL();
            DataSet ds = stDl.GetStudentId(this);
            studentid = Convert.ToInt32(ds.Tables[0].Rows[0][0]);

        }


        public DataTable PopulateGender()
        {
            StudentDL stDl = new StudentDL();
           
            DataSet ds = null;
            ds = stDl.populategender();


            DynamicTranslation DTL = new DynamicTranslation();
           // langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();
            if (LangTool != "en")
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string origtext = ds.Tables[0].Rows[i]["gender_nm"].ToString();

                    string trantext = DTL.Translate(origtext, "", "");
                    ds.Tables[0].Rows[i]["gender_nm"] = trantext;


                }
            }


            return ds.Tables[0];

        }
        public void Savecontrolorder()
        {
            StudentDL stDl = new StudentDL();
            stDl.SaveControlOrder(this);
        }

        //---------------------------------Tito-----------------------------------------------------//

        public System.Data.DataTable GetNextCategory()
        {

            StudentDL stDl = new StudentDL();
            DataTable dt = stDl.getnextcategory(this);
            return dt;
        }

        public System.Data.DataTable GetPrevCategory()
        {

            StudentDL stDl = new StudentDL();
            DataTable dt = stDl.getprevcategory(this);
            return dt;
        }

      

        public System.Data.DataTable GetFieldsByCategory()
        {

            StudentDL StInfoView = new StudentDL();
            DataTable dt = StInfoView.getfieldsbycategory(this);

            DynamicTranslation DTL = new DynamicTranslation();
           // langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();

            if (LangTool == "")
            {
                LangTool = "en";
            }
            if (LangTool != "en")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string origtext = dt.Rows[i]["FieldName"].ToString();

                    string trantext = DTL.Translate(origtext, "en", LangTool);
                    dt.Rows[i]["FieldName"] = trantext;
                }
            }


            return dt;
        }

        public System.Data.DataTable GetFirstCategory()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.getfirstcategory(this);
            return dt;
        }
        public int CheckAddressField()
        {

            StudentDL stdl = new StudentDL();
            int count = stdl.checkaddressfield(this);
            return count;
        }
        public System.Data.DataTable GetAddressFieldsByFieldId()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.getaddressfieldsbyfieldid(this);


            DynamicTranslation DTL = new DynamicTranslation();
            //langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();


            if (LangTool != "en")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string origtext = dt.Rows[i]["FieldName"].ToString();

                    string trantext = DTL.Translate(origtext, "en", LangTool);
                    dt.Rows[i]["FieldName"] = trantext;
                }
            }

            return dt;
        }



        //add student

        public int AddStudent()
        {
            StudentDL stdl = new StudentDL();
            int id = 0;
            return id;

        }

        public void AddStudentdata()
        {
            StudentDL SADL = new StudentDL();


        }

        public System.Data.DataTable PopulateAdditionalField()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.populateadditionalfield(this);

            DynamicTranslation DTL = new DynamicTranslation();
            //langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();


            if (LangTool != "en")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string origtext = dt.Rows[i]["FieldName"].ToString();

                    string trantext = DTL.Translate(origtext, "en", LangTool);
                    dt.Rows[i]["FieldName"] = trantext;
                }
            }
            return dt;
        }

        public void InsertIntoStudentDetails()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentdetails(this);
        }
        public DataTable PopulateContactRelationship()
        {
            StudentDL stdl = new StudentDL();
           // ddl.Items.Clear();
            DataSet ds = null;
            ds = stdl.populatecontactrelationship();
            return ds.Tables[0];
            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "person_stu_rel_type_nm";
            //ddl.DataValueField = "person_rel_id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));


        }


        public void PopulateYesNo(ref System.Web.UI.WebControls.RadioButtonList rdb)
        {

            rdb.Items.Clear();

            rdb.Items.Insert(0, new ListItem("Yes", "Y"));
            rdb.Items.Insert(1, new ListItem("No", "N"));


        }



        public void InsertIntoStudentAdddressDetails()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentadddressdetails(this);
        }

        public void InsertIntoStudentAdditionalContact()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentadditionalcontact(this);
        }
        //*********************************photo save(saikat-14/10/2009)***********************************

        public void SaveStudentPhoto()
        {
            StudentDL stDl = new StudentDL();
            stDl.savestudentphoto(this);
        }
        //*********************************photo save(saikat-14/10/2009)***********************************

        public int CountSetFields()
        {

            StudentDL StEditInfo = new StudentDL();
            int count = StEditInfo.countsetfields(this);
            return count;
        }
        //--------------------------------------------------------------------------------------------------

        public System.Data.DataTable GetVaccinationFields()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.getvaccinationfields(this);
            return dt;
        }

        public System.Data.DataTable GetMedicalInfoFields()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.getmedicalinfofields(this);
            return dt;
        }

        public void InsertIntoStudentMedicalInformationDetails()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentmedicalinformationdetails(this);
        }

        public void InsertIntoStudentImmunizationDetails()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentimmunizationdetails(this);
        }

        public void InsertIntoStudentNurseVisitRecordDetails()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentnursevisitrecorddetails(this);
        }

        public void InsertIntoStudentVaccinationRecordDetails()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentvaccinationrecorddetails(this);
        }

        public void InsertIntoStudentMedicalAlert()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintostudentmedicalalert(this);
        }

        //enrollment
        public void InsertEnrollment()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertintoenrollment(this);
        }
        //enrollment to be added in osis-vss
        public DataTable Getstudentschoolenroll()
        {
            StudentDL stDl = new StudentDL();
            DataTable dt = null;
            dt = stDl.Getstudentschoolenroll(this);
            return dt;
        }
        public void UpdateEnrollment()
        {
            StudentDL stDl = new StudentDL();
            stDl.UpdateEnrollment(this);
        }

        public void DeleteEnrollment()
        {
            StudentDL stDl = new StudentDL();
            stDl.DeleteEnrollment(this);
        }

        //Special and gifted starts here

        public System.Data.DataTable PopulateSpecialField()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.PopulateSpecialField(this);

            DynamicTranslation DTL = new DynamicTranslation();
           // langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();


            if (LangTool != "en")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string origtext = dt.Rows[i]["FieldName"].ToString();

                    string trantext = DTL.Translate(origtext, "en", LangTool);
                    dt.Rows[i]["FieldName"] = trantext;
                }
            }
            return dt;
        }

        public System.Data.DataTable PopulateGiftField()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.PopulateGiftField(this);

            DynamicTranslation DTL = new DynamicTranslation();
           // langto = System.Web.HttpContext.Current.Session["MLUICulture"].ToString();


            if (LangTool != "en")
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string origtext = dt.Rows[i]["FieldName"].ToString();

                    string trantext = DTL.Translate(origtext, "en", LangTool);
                    dt.Rows[i]["FieldName"] = trantext;
                }
            }
            return dt;
        }


        public DataTable PopulateEvaluationType()
        {
            StudentDL stDl = new StudentDL();
            //ddl.Items.Clear();
            DataSet ds = null;
            ds = stDl.PopulateEvaluationType();
            return ds.Tables[0];

            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "evaluation_type_nm";
            //ddl.DataValueField = "evaluation_type_id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }
        public DataTable PopulateDisabilities()
        {
            StudentDL stDl = new StudentDL();
            //ddl.Items.Clear();
            DataSet ds = null;
            ds = stDl.PopulateDisabilities();
            return ds.Tables[0];
            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "Disability_nm";
            //ddl.DataValueField = "Disability_Id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }
        public DataTable PopulateGiftedCategory()
        {
            StudentDL stDl = new StudentDL();
           // ddl.Items.Clear();
            DataSet ds = null;
            ds = stDl.PopulateGiftedCategory();
            return ds.Tables[0];
            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "Gift_Cat_nm";
            //ddl.DataValueField = "Gift_Cat_Id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }
        public DataTable PopulateSpecialEduStatus()
        {
            StudentDL stDl = new StudentDL();
           // ddl.Items.Clear();
            DataSet ds = null;
            ds = stDl.PopulateSpclEduStatus();
            return ds.Tables[0];
            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "Special_Edn_Status_nm";
            //ddl.DataValueField = "Special_Edn_Status_Id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }
        public DataTable PopulateSpecialEduExistStatus()
        {
            StudentDL stDl = new StudentDL();
           // ddl.Items.Clear();
            DataSet ds = null;
            ds = stDl.PopulateSpclEduExistStatus();
            return ds.Tables[0];
            //ddl.DataSource = ds.Tables[0];
            //ddl.DataTextField = "Specl_Edn_Exist_Stat_nm";
            //ddl.DataValueField = "Specl_Edn_Exist_Stat_id";
            //ddl.DataBind();
            //ddl.Items.Insert(0, new ListItem("Select", "0"));

        }
        public void InsertSpecialValue()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertspecialvalue(this);
        }
        public void InsertgiftedValue()
        {
            StudentDL stDl = new StudentDL();
            stDl.insertgiftvalue(this);
        }

        //**********
        public System.Data.DataTable GetVaccinationfieldsWithValue()
        {

            StudentDL stdl = new StudentDL();
            DataTable dt = stdl.VaccinationfieldsWithValue(this);
            return dt;
        }

    }
}